package com.gec.domain;

import java.util.ArrayList;
import java.util.List;


public class Menu {
    private String id;
    private String parentId;   //大菜单的名称
    private String menuName;
    private String mapping;
    private String visible;
    private String permission;
    private String isAdmin;

    public Menu() {
    }

    public Menu(String line) {
        //id,pId,menuName,mapping,visible
        String[] sp = line.split(",");
        this.id = sp[0];
        this.parentId = sp[1];
        this.menuName = sp[2];
        this.mapping = sp[3];
        this.visible = sp[4];
    }

    private List<Menu> subMenus = new ArrayList<>();

    public List<Menu> getSubMenus() {
        return this.subMenus;
    }

    public void addMenu(Menu menu) {
        subMenus.add(menu);
    }


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getMenuName() {
        return menuName;
    }

    public void setMenuName(String menuName) {
        this.menuName = menuName;
    }

    public String getMapping() {
        return mapping;
    }

    public void setMapping(String mapping) {
        this.mapping = mapping;
    }

    public String getVisible() {
        return visible;
    }

    public void setVisible(String visible) {
        this.visible = visible;
    }

    public String getIsAdmin() {
        return isAdmin;
    }

    public void setIsAdmin(String isAdmin) {
        this.isAdmin = isAdmin;
    }

    public String getPermission() {
        return permission;
    }

    public void setPermission(String permission) {
        this.permission = permission;
    }

    public void setSubMenus(List<Menu> subMenus) {
        this.subMenus = subMenus;
    }

    @Override
    public String toString() {
        return "Menu{" +
                "id='" + id + '\'' +
                ", parentId='" + parentId + '\'' +
                ", menuName='" + menuName + '\'' +
                ", mapping='" + mapping + '\'' +
                ", visible='" + visible + '\'' +
                ", isAdmin='" + isAdmin + '\'' +
                ", permission='" + permission + '\'' +
                '}';
    }
}







